package com.icecola.d9_tz;

public class MyRunnable implements Runnable {
    private int count; //记录浏览人次

    @Override
    public void run() {
        // 需要把当前count取出来再加
        // 100次
        for (int i = 0; i < 100; i++) {
            String name = Thread.currentThread().getName();
            synchronized (this) {
                System.out.println(name + "count ====> " + (++count));
            }
        }


    }
}
